home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / tbbs / prgsourc.zip / FLAGS.ZIP / FLAGMGR.PRG < prev    next >
Text File  |  1996-04-08  |  9KB  |  324 lines

  1. SET ESCAPE OFF
  2. SET FORMAT TO fscr NOCLEAR
  3. SET INTENSITY OFF
  4.  
  5. SELECT a
  6. USE fnames
  7.  
  8. SELECT b
  9. USE flags INDEX user
  10. COUNT TO e
  11. GOTO TOP
  12.  
  13. DECLARE usrn[e]
  14.  
  15. us = 1
  16. DO WHILE us < e       
  17.    usrn[us] = usr
  18.    us = us + 1
  19.    SKIP
  20. ENDDO
  21. usrn[us] = usr
  22.  
  23. DO Scr
  24.  
  25. tPag = Ceiling(e/17)                   && Total pages
  26. us = 1                                   && Current User
  27. pag = 1                                  && Current page
  28. r = 2                                  && Current r
  29.  
  30.  
  31. DO Lst 
  32.  
  33. SET COLOR TO GR+/R
  34. @ r,8 SAY usrn[us]
  35.  
  36. SET COLOR TO N/N
  37. k = " "
  38. @ 2,0 GET k
  39. DO WHILE .T.
  40.    READ                                          
  41.    DO CASE
  42.       CASE LastKey() = 3                         && <Page Down>
  43.            IF us = e
  44.               LOOP
  45.            ENDIF
  46.            IF pag = tPag
  47.               SET COLOR TO W+/N
  48.               @ r,8 SAY usrn[us]
  49.               r = r + (e - us)
  50.               us = e
  51.               SET COLOR TO GR+/R
  52.               @ r,8 SAY usrn[us]
  53.               LOOP
  54.            ELSE
  55.               IF (us + 20) > e
  56.                  r = r - ((us + 20) - e)
  57.                  us = e
  58.               ELSE   
  59.                  us = us + 20
  60.               ENDIF
  61.               pag = pag + 1
  62.            ENDIF
  63.  
  64.       CASE LastKey() = 5                         && Up Arrow
  65.            IF us = 1
  66.               LOOP
  67.            ENDIF
  68.            IF r = 2                           
  69.               us = us - 1
  70.               pag = pag - 1
  71.               r = 21
  72.            ELSE
  73.               SET COLOR TO W+/N
  74.               @ r,8 SAY usrn[us]
  75.               r = r - 1
  76.               us = us - 1
  77.               SET COLOR TO GR+/R
  78.               @ r,8 SAY usrn[us]
  79.               LOOP
  80.            ENDIF
  81.            
  82.       CASE LastKey() = 18                        && <Page Up>
  83.            IF us = 1
  84.               LOOP
  85.            ENDIF
  86.            IF pag = 1
  87.               SET COLOR TO W+/N
  88.               @ r,8 SAY usrn[us]
  89.               r = r - (us - 1)
  90.               us = 1
  91.               SET COLOR TO GR+/R
  92.               @ r,8 SAY usrn[us]
  93.               LOOP
  94.            ELSE
  95.               us = us - 20
  96.               pag = pag - 1
  97.            ENDIF
  98.       
  99.       CASE LastKey() = 24                        && Down Arrow
  100.            IF us = e
  101.               LOOP
  102.            ENDIF
  103.            IF r = 21
  104.               us = us + 1
  105.               pag = pag + 1
  106.               r = 2                   
  107.            ELSE
  108.               SET COLOR TO W+/N
  109.               @ r,8 SAY usrn[us]
  110.               r = r + 1
  111.               us = us + 1
  112.               SET COLOR TO GR+/R
  113.               @ r,8 SAY usrn[us]
  114.               LOOP
  115.            ENDIF
  116.       
  117.       CASE LastKey() = 27                   && <Esc>
  118.            QUIT                                
  119.       
  120.       CASE LastKey() = 13                          && <Enter>
  121.            SEEK usrn[us]
  122.            k = " "
  123.            DO WHILE .T.
  124.               SET COLOR TO W+/N
  125.               @ 1,0 CLEAR TO 22,79
  126.               SET COLOR TO B/B
  127.               @ 23,0 CLEAR TO 23,79
  128.               SET COLOR TO GR+/B
  129.               @ 23,5 SAY "<Enter>"
  130.               @ 23,40 SAY "<Esc>"
  131.               SET COLOR TO W+/B
  132.               @ 0,40 SAY "<< " + usrn[us] + " >>"
  133.               @ 23,13 SAY "= Change Flag"
  134.               @ 23,46 SAY "= Return to user list"
  135.               DO fList
  136.               SET FORMAT TO fscr NOCLEAR
  137.               READ
  138.               DO CASE 
  139.                  CASE LastKey() = 27
  140.                       EXIT
  141.                  CASE LastKey() = 13
  142.                       ch = "   "
  143.                       nflg = " "
  144.                       SET COLOR TO B/B
  145.                       @ 23,0 CLEAR TO 23,79
  146.                       SET COLOR TO GR+/B
  147.                       @ 23,5 SAY "QIT"
  148.                       SET COLOR TO W+/B
  149.                       @ 23,9 SAY "= Change NO flags"
  150.                       @ 23 40 SAY "Enter flag number/name, and new value" 
  151.                       @ 7,25 CLEAR TO 10,45
  152.                       @ 8,27 SAY "Change flag: "
  153.                       @ 9,27 SAY "New Value: "
  154.                       SET FORMAT TO fget NOCLEAR
  155.                       READ
  156.                       DO CASE 
  157.                          CASE "V" $ Upper(ch) 
  158.                               DO CASE
  159.                                  CASE Upper(nflg) = "Y" .OR. Upper(nflg) = "T"
  160.                                       REPLACE vis WITH .T.
  161.                                  CASE Upper(nflg) = "N" .OR. Upper(nflg) = "F"
  162.                                       REPLACE vis WITH .F.
  163.                                  OTHERWISE
  164.                                       LOOP
  165.                               ENDCASE
  166.                          
  167.                          CASE "R" $ Upper(ch) 
  168.                               DO CASE
  169.                                  CASE Upper(nflg) = "Y" .OR. Upper(nflg) = "T"
  170.                                       REPLACE reg WITH .T.
  171.                                  CASE Upper(nflg) = "N" .OR. Upper(nflg) = "F"
  172.                                       REPLACE reg WITH .F.
  173.                                  OTHERWISE
  174.                                       LOOP
  175.                               ENDCASE
  176.                               
  177.                          CASE "A" $ Upper(ch) 
  178.                               DO CASE
  179.                                  CASE Upper(nflg) = "Y" .OR. Upper(nflg) = "T"
  180.                                       REPLACE age WITH .T.
  181.                                  CASE Upper(nflg) = "N" .OR. Upper(nflg) = "F"
  182.                                       REPLACE age WITH .F.
  183.                                  OTHERWISE
  184.                                       LOOP
  185.                               ENDCASE
  186.                               
  187.                          CASE "Y" $ Upper(ch) 
  188.                               DO CASE
  189.                                  CASE Upper(nflg) = "Y" .OR. Upper(nflg) = "T"
  190.                                       REPLACE ysn WITH .T.
  191.                                  CASE Upper(nflg) = "N" .OR. Upper(nflg) = "F"
  192.                                       REPLACE ysn WITH .F.
  193.                                  OTHERWISE
  194.                                       LOOP
  195.                               ENDCASE
  196.                               
  197.                          CASE "Q" $ Upper(ch) 
  198.                               EXIT
  199.                          
  200.                          CASE Val(ch) < 97 .AND. Val(ch) > 0
  201.                               ch = Val(ch)
  202.                               newflg = Stuff(flg,ch,1,nflg)
  203.                               REPLACE flg WITH newflg
  204.  
  205.                          OTHERWISE 
  206.                               LOOP
  207.                       ENDCASE
  208.               ENDCASE
  209.            ENDDO
  210.            SET FORMAT TO fscr NOCLEAR
  211.            DO Scr
  212.  
  213.       OTHERWISE
  214.            LOOP
  215.    ENDCASE
  216.    DO Lst
  217.    SET COLOR TO GR+/R
  218.    @ r,8 SAY usrn[us]
  219. ENDDO
  220. QUIT
  221.  
  222. **************************************************
  223. PROCEDURE Scr
  224.  
  225. SET COLOR TO N/N
  226. @ 0,0 CLEAR
  227. SET COLOR TO B/B
  228. @ 0,0 CLEAR TO 0,79
  229. @ 23,0 CLEAR TO 23,79
  230. SET COLOR TO GR+/B
  231. @ 0,5 SAY "Flag Manager b.03" 
  232. @ 23,5 SAY "<Enter>"
  233. @ 23,40 SAY "<Esc>"
  234. SET COLOR TO W+/B
  235. @ 23,13 SAY "= Select User"
  236. @ 23,46 SAY "= Quit"
  237. RETURN
  238.  
  239. **************************************************
  240. PROCEDURE Lst
  241.  
  242. PRIVATE r
  243. r = 2
  244. u = Int((pag-1)*20) + 1         
  245.  
  246. SET COLOR TO N/N
  247. @ 2,0 CLEAR TO 20,79
  248. DO WHILE r <= 21                             
  249.    SET COLOR TO GR+/N                      
  250.    @ r,1 SAY "["                           
  251.    @ r,2 SAY u PICTURE "@Z 999"
  252.    @ r,5 SAY "]"                           
  253.    SET COLOR TO W+/N
  254.    @ r,8 SAY usrn[u]
  255.    IF u = e
  256.       EXIT
  257.    ENDIF
  258.    r = r + 1                            
  259.    u = u + 1
  260. ENDDO
  261. RETURN
  262.  
  263. *************************************************
  264. PROCEDURE fList
  265.  
  266. SELECT a
  267. GOTO TOP
  268. SELECT b
  269.  
  270. x = 1
  271. y = 0
  272. z = 1
  273. DO WHILE z <= 96
  274.    SET COLOR TO GR+/N
  275.    @ x+1,y+0 SAY LTrim(Str(z))
  276.    
  277.    SELECT a
  278.    @ x+1,y+5 SAY fnam
  279.    IF z < 96
  280.       SKIP
  281.    ENDIF
  282.    SELECT b
  283.    
  284.    SET COLOR TO W+/N
  285.    @ x+1,y+3 SAY SubStr(flg,z,1)
  286.    x = x + 1
  287.    z = z + 1
  288.    IF x = 21
  289.       x = 1
  290.       y = y + 15
  291.    ENDIF
  292. ENDDO    
  293. SET COLOR TO R+/N
  294. @ 18,60 SAY "VIS"
  295. SET COLOR TO G+/N
  296. @ 19,60 SAY "REG"
  297. SET COLOR TO RB+/N
  298. @ 20,60 SAY "AGE"
  299. SET COLOR TO B+/N
  300. @ 21,60 SAY "YSN"
  301. SET COLOR TO W+/N
  302. IF VIS
  303.    @ 18,64 SAY "YES"
  304. ELSE
  305.    @ 18,64 SAY "NO"
  306. ENDIF
  307. IF REG
  308.    @ 19,64 SAY "YES"
  309. ELSE
  310.    @ 19,64 SAY "NO"
  311. ENDIF
  312. IF AGE
  313.    @ 20,64 SAY "YES"
  314. ELSE
  315.    @ 20,64 SAY "NO"
  316. ENDIF
  317. IF YSN
  318.    @ 21,64 SAY "YES"
  319. ELSE
  320.    @ 21,64 SAY "NO"
  321. ENDIF
  322.  
  323. RETURN
  324.